
/*
8 avr. 2012 jblanchard 
*/

package org.jcb.control;

import java.util.List;

import org.jcb.control.dao.data.ChineseDatabase;
import org.jcb.control.dto.ChineseQuestionnaire;
import org.jcb.control.dto.DataChineseLanguage;
import org.jcb.control.service.GenerateQuestionnaireRandomStrategy;


public class Main {

	
	/**
	 * @param args
	 * @throws InterruptedException 
	 */
	public static void main(String[] args) throws InterruptedException {
		List<DataChineseLanguage> data = ChineseDatabase.loadData();
		ChineseQuestionnaire cq = GenerateQuestionnaireRandomStrategy.generate(data, "1", 20);
		for (int i = 0 ; i < cq.getNbQuestion() ; i++) {
			System.out.println(cq.getChineseQuestion(i));
			Thread.sleep(2000);
			System.out.println(cq.getPinyin(i) + " " + cq.getCarCompose(i));
			if (cq.getExample(i).length() > 0) {
				System.out.println(cq.getExample(i));
			}
			Thread.sleep(500);
		}
		
	}

}
